import Vue from 'vue'

import Router from 'vue-router';

import Login from '../views/login/login.vue'
import Layout from '../views/layout/layout.vue'
import Template from '../views/Project-archives-management/Template.vue'

/* const originalPush = VueRouter.prototype.push;
//重写
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
} */
Vue.use(Router)


export default new Router({
  mode: "hash",
  base: '/dist',
  /*  scrollBehavior(to, from, savePosition) {
     if (savePosition) {
       //解决页面从列表页跳转到详情页返回,初始在原来位置
       return savePosition
     } else {
       //解决页面跳转后页面高度和前一个页面高度一样
       return { x: 0, y: 0 }
     }
   }, */

  //登录
  routes: [{
    path: "/login",
    component: Login,
  },
  //后台首页
  {
    path: "/",
    component: Layout,
    redirect: "/home",
    children: [{
      path: "/home",
      meta: { path: "/home", title: '后台首页' },
      component: () => import("../views/home/home.vue")

    }]

  },
  //用户库
  {
    path: "/user",
    component: Layout,
    meta: { path: "/user", title: '用户库' },
    redirect: "/user/user-menList",
    children: [
      {
        path: "/user/user-menList",
        meta: { path: "/user/user-menList", title: '成员列表' },
        component: () => import("../views/Userlibrary/memberList.vue")
      },
      {
        path: "/user/user-roleList",

        meta: { path: "/user/user-roleList", title: '角色列表', isBack: false },
        component: () => import("../views/Userlibrary/roleList.vue")
      },
      {
        path: "/user/user-promis",

        meta: { path: "/user/user-promis", title: '权限菜单管理' },
        component: () => import("../views/Userlibrary/permissionMenu.vue")
      },
      {
        path: "/user/user-registration",
        meta: { path: "/user/user-registration", title: '成员注册' },
        component: () => import("../views/Userlibrary/memberRegistration.vue")
      },
      {
        path: "/user/user-companies",
        meta: { path: "/user/user-companies", title: '公司列表' },
        component: () => import("../views/Userlibrary/companies.vue")
      }

    ]
  },
  //组织架构
  {
    path: "/org",
    component: Layout,

    children: [
      {
        path: "/",
        meta: { path: "/org", title: '组织架构' },
        component: () => import("../views/organizational-structure/organizationalStructure.vue")
      },
    ]
  },
  //项目档案管理
  {
    path: "/project",
    component: Layout,
    meta: { path: "/project", title: '项目档案管理' },
    redirect: "/project/project-class",
    children: [
      {
        path: "/project/project-class",
        meta: { path: "/project/project-class", title: '分类模板管理' },
        component: () => import("../views/Project-archives-management/ClassifiedDirectoryManagement.vue")
      },
      {
        path: "/project/project-Catalogue",
        meta: { path: "/project/project-Catalogue", title: '分类目录管理' },
        component: () => import("../views/Project-archives-management/Catalogue.vue")
      },
      {
        path: "/project/project-stand",
        meta: { path: "/project/project-stand", title: '案卷规范管理' },
        component: () => import("../views/Project-archives-management/StandardizedManagement.vue")
      },
      {
        path: "/project/project-class/template",
        meta: { path: "/project/project-class/template", title: '模板' },
        component: () => import("../views/Project-archives-management/children/Template.vue")
      },
      {
        path: "/project/template",
        component: Template,
        meta: { path: "/project/template", title: '案卷构成模板' },
        redirect: "/project/template/template-cover",
        children: [
          {
            path: "/project/template/template-cover",
            meta: { path: "/template/template-cover", title: '案卷封面' },
            component: () => import("../views/Project-archives-management/template-management/caseCover.vue")
          },
          {
            path: "/project/template/template-Test",
            meta: { path: "/template/template-Test", title: '备考表' },
            component: () => import("../views/Project-archives-management/template-management/testPreparation.vue")
          },
          {
            path: "/project/template/template-volume",
            meta: { path: "/template/template-volume", title: '卷内目录' },
            component: () => import("../views/Project-archives-management/template-management/volumeDirectory.vue")
          },
          {
            path: "/project/template/template-file",
            meta: { path: "/template/template-file", title: '案卷目录' },
            component: () => import("../views/Project-archives-management/template-management/fileList.vue")
          },
          {
            path: "/project/template/template-citation",
            meta: { path: "/template/template-citation", title: '全引目录' },
            component: () => import("../views/Project-archives-management/template-management/citationDirectory.vue")
          },
          {
            path: "/project/template/template-Filebox",
            meta: { path: "/template/template-Filebox", title: '案卷盒子' },
            component: () => import("../views/Project-archives-management/template-management/FileBox.vue")
          },

        ],
      },
    ]
  },
  //案卷模板管理
  /*  {
     path: "/template",
     component: Layout,
     meta: { path: "/template", title: '案卷模板管理' },
     redirect: "/template/template-cover",
     children: [
       {
         path: "/template/template-cover",
         meta: { path: "/template/template-cover", title: '案卷封面' },
         component: () => import("../views/template-management/caseCover.vue")
       },
       {
         path: "/template/template-Test",
         meta: { path: "/template/template-Test", title: '备考表' },
         component: () => import("../views/template-management/testPreparation.vue")
       },
       {
         path: "/template/template-volume",
         meta: { path: "/template/template-volume", title: '卷内目录' },
         component: () => import("../views/template-management/volumeDirectory.vue")
       },
       {
         path: "/template/template-file",
         meta: { path: "/template/template-file", title: '案卷目录' },
         component: () => import("../views/template-management/fileList.vue")
       },
       {
         path: "/template/template-citation",
         meta: { path: "/template/template-citation", title: '全引目录' },
         component: () => import("../views/template-management/citationDirectory.vue")
       },
 
     ],
   }, */
  //项目列表
  {
    path: "/project",
    component: Layout,


    children: [
      {
        path: "/project/template-item",
        meta: { path: "/project", title: '项目列表' },
        component: () => import("../views/project/ItemList.vue"),
      },
      {
        path: "/project/template-item/filing",
        meta: { path: "/project/template-item/filing", title: '立卷阶段的参建单位' },
        component: () => import("../views/project/children/filingStage.vue"),
      },

      {
        /* 29号 */
        path: "/project/template-item/filing/Constructioneight",
        meta: { path: "/project/template-item/filing/Constructioneight", title: '案卷目录' },
        component: () => import("../views/project/children/grandson/ConstructionEight.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 8号 */
        path: "/project/template-item/filing/Constructiontwentynine",
        meta: { path: "/project/template-item/filing/Constructiontwentynine", title: '案卷目录' },
        component: () => import("../views/project/children/grandson/ConstructionTwentyNine.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 案卷目录照片档案 */
        path: "/project/template-item/filing/Photoarchives",
        meta: { path: "/project/template-item/filing/Photoarchives", title: '案卷照片档案' },
        component: () => import("../views/project/children/grandson/PhotoArchives.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 卷内目录照片档案 */
        path: "/project/template-item/filing/InsidePhoto",
        meta: { path: "/project/template-item/filing/InsidePhoto", title: '卷内照片档案' },
        component: () => import("../views/project/children/grandson/great-grandson/InsidePhoto.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 案卷目录音像档案 */
        path: "/project/template-item/filing/audioArchives",
        meta: { path: "/project/template-item/filing/audioArchives", title: '案卷音像档案' },
        component: () => import("../views/project/children/grandson/audioArchives.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 卷内目录音像档案 */
        path: "/project/template-item/filing/insideAudio",
        meta: { path: "/project/template-item/filing/insideAudio", title: '卷内音像档案' },
        component: () => import("../views/project/children/grandson/great-grandson/insideAudio.vue"),
        /* redirect: "/template/template-item/filing/construction/volumeDirectory", */
      },
      {
        /* 29号 */
        path: "/project/template-item/filing/construction/volumeDirectorytwentynine",
        meta: { path: "/project/template-item/filing/construction/volumeDirectorytwentynine", title: '卷内目录' },
        component: () => import("../views/project/children/grandson/great-grandson/InvolumeDirectoryTwentyNine.vue"),
      },
      {
        /* 8号 */
        path: "/project/template-item/filing/construction/volumeDirectoryeight",
        meta: { path: "/project/template-item/filing/construction/volumeDirectoryeight", title: '卷内目录' },
        component: () => import("../views/project/children/grandson/great-grandson/InvolumeDirectoryEight.vue"),
      },
      {
        /* 检索阶段卷内目录 */
        path: "/project/template-item/filing/construction/SearchVolume",
        meta: { path: "/project/template-item/filing/construction/SearchVolume", title: '检索卷内目录' },
        component: () => import("../views/project/children/grandson/great-grandson/SearchVolume.vue"),
      },
      {
        /* 下载记录 */
        path: "/project/Download",
        meta: { path: "/project/Download", title: '下载记录' },
        component: () => import("../views/project/children/grandson/great-grandson/Download.vue"),
      },


      {
        path: "/project/template-item/filing/matching",
        meta: { path: "/project/template-item/filing/matching", title: '检索单位' },
        component: () => import("../views/project/children/grandson/Matching.vue"),
      },
      /* 检索阶段的参建单位下的案卷目录 */
      {
        path: "/project/template-item/filing/matching/Searchfiles",
        meta: { path: "/project/template-item/filing/matching/Searchfiles", title: '检索阶段的案卷目录' },
        component: () => import("../views/project/children/grandson/Searchfiles.vue"),
      },

      {
        path: "/project/template-item/retrieval",
        meta: { path: "/project/template-item/retrieval", title: '检索分类' },
        component: () => import("../views/project/children/Retrieval.vue"),
        /*  redirect: "/template/template-item/retrieval/borrowing", */
      },

      {
        path: "/project/template-item/retrieval/borrowing",
        meta: { path: "/project/template-item/retrieval/borrowing", title: '借阅记录' },
        component: () => import("../views/project/children/grandson/Borrowing.vue"),
      },
      {
        path: "/project/template-item/retrieval/temperature",
        meta: { path: "/project/template-item/retrieval/temperature", title: '温湿度检测记录' },
        component: () => import("../views/project/children/grandson/Temperature.vue"),
      },
    ]
  },

  //审批管理
  {
    path: "/app",
    component: Layout,
    meta: { path: "/app", title: '审批管理' },
    redirect: "/app/app-config",
    children: [
      {
        path: "/app/app-config",
        meta: { path: "/app/app-config", title: '案卷审批' },
        component: () => import("../views/Approval-configuration/approvalConfiguration.vue")
      },
      {
        path: "/app/app-cateApp",
        meta: { path: "/app/app-cateApp", title: '目录审批' },
        component: () => import("../views/Approval-configuration/catalogApproval.vue")
      },
      {
        path: "/app/app-class",
        meta: { path: "/app/app-class", title: '分类审批' },
        component: () => import("../views/Approval-configuration/classifiedApproval.vue")
      },
      {
        path: "/app/app-stage",
        meta: { path: "/app/app-stage", title: '借阅审批' },
        component: () => import("../views/Approval-configuration/StageApproval.vue")
      },
      {
        path: "/app/common/AppCom",
        meta: { path: "/app/common/AppCom", title: '审批案卷内容' },
        component: () => import("../views/Approval-configuration/common/ApprovalCom.vue")
      },
      {
        path: "/app/common/children/AppCom",
        meta: { path: "/app/common/children/AppCom", title: '审批卷内内容' },
        component: () => import("../views/Approval-configuration/common/children/InvolumeApproval.vue")
      },
    ]
  },
  //回收站
  {
    path: "/recycle",
    component: Layout,
    meta: { path: "/recycle", title: '回收站' },
    redirect: "/recycle/recycle-member",
    children: [
      {
        path: "/recycle/recycle-member",
        meta: { path: "/recycle/recycle-member", title: '成员' },
        component: () => import("../views/recycle-bin/member.vue")
      },
      {
        path: "/recycle/recycle-file",
        meta: { path: "/recycle/recycle-file", title: '项目案卷目录' },
        component: () => import("../views/recycle-bin/file.vue")
      },
      {
        path: "/recycle/recycle-catalogue",
        meta: { path: "/recycle/recycle-catalogue", title: '项目卷内目录' },
        component: () => import("../views/recycle-bin/catalogue.vue")
      },
     /*  {
        path: "/recycle/recycle-company",
        meta: { path: "/recycle/recycle-company", title: '公司' },
        component: () => import("../views/recycle-bin/company.vue")
      }, */
      /* {
        path: "/recycle/recycle-Cover",
        meta: { path: "/recycle/recycle-Cover", title: '案卷构成封面' },
        component: () => import("../views/recycle-bin/CoverRecycleBin.vue")
      },
      {
        path: "/recycle/recycle-FileRecycleBin",
        meta: { path: "/recycle/recycle-FileRecycleBin", title: '案卷构成案卷' },
        component: () => import("../views/recycle-bin/FileRecycleBin.vue")
      }, */
      {
        path: "/recycle/recycle-FileTemplateCombination",
        meta: { path: "/recycle/recycle-FileTemplateCombination", title: '案卷模板组合' },
        component: () => import("../views/recycle-bin/FileTemplateCombination.vue")
      },
      {
        path: "/recycle/recycle-FullDiversionRecyclingStation",
        meta: { path: "/recycle/recycle-FullDiversionRecyclingStation", title: '案卷构成模板' },
        component: () => import("../views/recycle-bin/FullDiversionRecyclingStation.vue")
      },
      {
        path: "/recycle/recycle-InVolumeDirectory",
        meta: { path: "/recycle/recycle-InVolumeDirectory", title: '借阅记录' },
        component: () => import("../views/recycle-bin/InVolumeDirectory.vue")
      },
      {
        path: "/recycle/recycle-ParticipatingUnits",
        meta: { path: "/recycle/recycle-ParticipatingUnits", title: '参建单位' },
        component: () => import("../views/recycle-bin/ParticipatingUnits.vue")
      },
      {
        path: "/recycle/recycle-ParticipatingUnitsCatalog",
        meta: { path: "/recycle/recycle-ParticipatingUnitsCatalog", title: '参建单位下分类目录' },
        component: () => import("../views/recycle-bin/ParticipatingUnitsCatalog.vue")
      },
      /*   {
          path: "/recycle/recycle-ReferenceFormRecycleBin",
          meta: { path: "/recycle/recycle-ReferenceFormRecycleBin", title: '案卷构成备考表' },
          component: () => import("../views/recycle-bin/ReferenceFormRecycleBin.vue")
        }, */
      {
        path: "/recycle/recycle-TemplateClassification",
        meta: { path: "/recycle/recycle-TemplateClassification", title: '分类模板' },
        component: () => import("../views/recycle-bin/TemplateClassification.vue")
      },
      {
        path: "/recycle/recycle-role",
        meta: { path: "/recycle/recycle-role", title: '角色' },
        component: () => import("../views/recycle-bin/role.vue")
      },
      {
        path: "/recycle/recycle-project",
        meta: { path: "/recycle/recycle-project", title: '项目' },
        component: () => import("../views/recycle-bin/project.vue")
      },
      {
        path: "/recycle/recycle-jurisdiction",
        meta: { path: "/recycle/recycle-jurisdiction", title: '权限' },
        component: () => import("../views/recycle-bin/jurisdiction.vue")
      },
      {
        path: "/recycle/recycle-classCatalogue",
        meta: { path: "/recycle/recycle-classCatalogue", title: '分类目录' },
        component: () => import("../views/recycle-bin/ClassificationCatalogue.vue")
      },
    ]
  },
  //系统设置
  {
    path: "/sys",
    component: Layout,

    children: [
      {
        path: "/",
        meta: { path: "/sys", title: '系统设置' },
        component: () => import("../views/System/System.vue")
      },
    ]
  },
  //操作记录
  {
    path: "/record",
    component: Layout,

    children: [
      {
        path: "/",
        meta: { path: "/record", title: '操作记录' },
        component: () => import("../views/OperationRecord/OperationRecord.vue")
      },
    ]
  },
  //审批配置
  {
    path: "/manage",
    component: Layout,
    children: [
      {
        path: "/",
        meta: { path: "/manage", title: '审批配置', isBack: false },
        component: () => import("../views/management/management.vue")
      },
    ]
  },
  //忘记密码
  {
    path: '/forget',

    component: () => import("../views/login/forgetPassword.vue")
  },
  //注册-企业
  {
    path: '/regist',

    component: () => import("../views/login/enterpriseRegistration.vue")
  }],

})

